import { RouterMode, PlatformType, EnvType, NavigationType } from '../enums';

/**
 * 路由跳转参数接口
 */
export interface RouteParams {
  name?: string;
  path?: string;
  query?: Record<string, any>;
  params?: Record<string, any>;
}

/**
 * 路由跳转选项接口
 */
export interface RouterPushOptions {
  /** 是否在新的webview中打开 */
  isOpenWebview?: boolean;
  /** 路由模式 */
  mode?: RouterMode;
  /** 是否隐藏导航栏 */
  hideNavigationBar?: boolean;
  /** 是否改变环境 */
  changeEnv?: boolean;
  /** 来源地址 */
  origin?: string;
}

/**
 * 平台信息接口
 */
export interface PlatformInfo {
  isYixinliApp: boolean;
  isZiXunApp: boolean;
  isQingSuApp: boolean;
  isZiXunShiApp: boolean;
  isMuseApp: boolean;
  isWebviewMp: boolean;
  yixinliAPPVersion?: string;
  museAPPVersion?: string;
}

/**
 * 运行环境接口
 */
export interface RunningEnv {
  env: string;
}

/**
 * 广告页面跳转对象接口
 */
export interface AdPageObject {
  url: string;
  object_name?: string;
  path?: string;
}

/**
 * Bridge接口
 */
export interface BridgeInterface {
  openWebView: (options: {
    url: string;
    isCurrentPageOpen: number;
    hideNavigationBar?: number;
  }) => void;
  cancelWebView: () => void;
  call: (method: string, params?: any) => void;
  openAppPage: (options: { routeName: string; param: string }) => void;
}

/**
 * UniApp导航接口
 */
export interface UniAppNavInterface {
  push: (options: { path: string }) => void;
  back: () => void;
}

/**
 * 用户信息接口
 */
export interface UserOtherInfo {
  isLogin: number;
}

/**
 * 全局总线接口
 */
export interface GlobalBus {
  userOtherInfo?: UserOtherInfo;
}
